<%@ page import="custom.*, java.util.*" %>
<html>
  <head>
    <title>Confirmation</title>
  </head>
  <body>
    <%
       Applicant apt = (Applicant)session.getAttribute("applicant");
       if(apt==null) {
           apt = new Applicant();
       }
       boolean result = false;
       String errMsg = "Submit failed.";
       if(apt.submitted == false) {
	       apt.first_name = (String)session.getAttribute("firstName");
	       apt.middle_name = (String)session.getAttribute("middleName");
	       apt.last_name = (String)session.getAttribute("lastName");
	       apt.ccid = (Integer)session.getAttribute("ccid");
	       apt.crid = (Integer)session.getAttribute("crid");
	       apt.street = (String)session.getAttribute("street");
	       apt.city = (String)session.getAttribute("city");
	       apt.state = (String)session.getAttribute("state");
	       apt.country_phone_code = (String)session.getAttribute("ctc");
	       apt.zip = (String)session.getAttribute("zip");
	       apt.area_code = (String)session.getAttribute("area");
	       apt.phone = (String)session.getAttribute("phone");
	       apt.specialization_id = (Integer)session.getAttribute("specializationId");
	       apt.setDegrees((Vector<LinkedHashMap<String, Object>>)session.getAttribute("degrees"));
	       result = apt.submit();
           session.setAttribute("applicant", apt);
       }
       else {
           errMsg = "You can only submit once in a session.";
       }
    %>
    <% if(result == true) { %>
    Submit succeed. Your application ID is <%= apt.id %>.
    <% } else {%>
    <%= errMsg %>
    <% } %>
  </body>
</html>
